{extends file="../lists.html"}

{block name=list_content}
<table class="layui-table list" lay-filter="list">
    <colgroup>
        <col width="20%"/>
        <col width="20%"/>
        <col width="20%"/>
        <col width="20%"/>
        <col width="20%"/>
    </colgroup>
    <thead>
        <tr>
            <th>字段</th>
            <th>字段名称</th>
            <th>类型</th>
            <th>空</th>
            <th>默认</th>
        </tr>
    </thead>
    <tbody>
        {foreach $list as $field}
        <tr>
            <td class="en-font copy-hidden">{$field.Field}<a class="layui-btn layui-btn-sm layui-btn-primary copy" data-clipboard-text="{$field.Field}">复制</a></td>
            <td>{$name=$field.Field}{$modelForm.$name.name}</td>
            <td class="en-font">{$field['Type']}</td>
            <td>{$field['Null']}</td>
            <td>{$field['Default']}</td>
        </tr>
        {/foreach}
    </tbody>
</table>
         
{/block}
{block name=page}
    
{/block}
{block name=script}
<script>
var clipboard = new Clipboard('.copy');

clipboard.on('success', function(e) {
    //console.info('Action:', e.action);
    //console.info('Text:', e.text);
    //console.info('Trigger:', e.trigger);
    layer.msg('复制成功');
    e.clearSelection();
});

clipboard.on('error', function(e) {
    //console.error('Action:', e.action);
    //console.error('Trigger:', e.trigger);
    layer.msg('复制失败');
});
</script>
{/block}